home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
United Public Domain Gold 2
/
United Public Domain Gold 2.iso
/
utilities
/
pu309.dms
/
pu309.adf
/
Satellite1
/
oscar.bas
< prev
next >
Wrap
BASIC Source File
|
1990-09-29
|
9KB
|
280 lines
1 REM W3IWI satellite tracker program for AMIGA, N3ET 5-22-86
3 REM Modified and updated by A C Hewat, G8NTH 1/9/88
5 REM New Keps 1/9/88
10 CLS:PRINT " OSCAR.BAS"
15 PRINT " Use control C to quit program."
20 DEFDBL A-Z
30 L9=51.268333# :W9=.56333 :REM User's LAT & LONG in decimal degrees, - east, south
33 H9=35:REM USER'S HEIGHT in meters above sea level (ASL) (G8NTH)
34 REM H9=H9/3.281 Conversion if only feet known
35 PPL%=84 :REM Pinter Page Length
40 ZT=0 :REM For EDT ZT=4/24, For EST ZT=5/24, For GMT ZT=0
41 IF ZT=4/24 THEN EXT$=" EDT "
42 IF ZT=5/24 THEN EXT$=" EST "
43 IF ZT=0 THEN EXT$=" GMT "
44 PRINT "All times are";EXT$;"change ZT for other.":PRINT
45 DIM S$(20),C%(13),SM(20)
48 REM JOLIAN DAYS, +1 FOR LEAP YEAR, 1988 C%(3)=60,C%(4)=91 . . .
49 REM else C%(3)=59,C%(4)=90 . . .
50 C%(1)=0:C%(2)=31:C%(3)=60:C%(4)=91:C%(5)=121:C%(6)=152
60 C%(7)=182:C%(8)=213:C%(9)=244:C%(10)=274:C%(11)=304:C%(12)=335
70 REM CONSTANTS
80 R0!=6378.16:G0=75369793000000#:G1=1.0027379093#:PI=3.141592653589793#
90 P2=2*PI:PR=PI/180:F=1/298.25:G2=.27469296# :REM 1988
100 REM SIDERAL TIME 365.246 DAYS/YEAR, USE BELOW FOR 1987 ETC.
110 REM 1987 G2=0.27535606 1988=0.27469296 1989=0.27676777
120 INPUT "HORIZON DEGREES (-90 to 0 to +90) ";E8%
130 INPUT "DURATION: (HOURS)";H1
140 PRINT "START ";EXT$;" (MM,DD,YY,HH,MM) ";
145 INPUT U1,U2,U3%,U4,U5
150 REM
160 RESTORE
165 IF PRT%=1 THEN CLOSE 1:PRT%=0
170 PRINT "PRINTER (Y/N) ? ";
175 GOSUB 2205
180 IF ZZ$="Y" THEN PRT%=1:OPEN "LPT1:" FOR OUTPUT AS 1
200 IF DISK%=1 THEN CLOSE 2:DISK%=0
210 PRINT "Disk (Y/N) ? ";
215 GOSUB 2205
230 IF ZZ$="Y" THEN INPUT "FILE NAME ";AA$:OPEN AA$ FOR OUTPUT AS 2:DISK%=1
240 T1=U2+C%(U1)+U4/24+U5/1440+ZT
250 T8=T1+H1/24
260 PRINT "START=";:PRINT USING "###.####";T1
270 PRINT " STOP=";:PRINT USING "###.####";T8
280 L8=L9*PR
290 S9=SIN(L8)
300 C9=COS(L8)
310 S8=SIN(-W9*PR)
320 C8=COS(W9*PR)
330 R9=R0!*(1-F/2+COS(2*L8)*(F/2))+H9/1000
340 L8=ATN((1-F)^2*S9/C9)
350 Z9=R9*SIN(L8)
360 X9=R9*COS(L8)*C8
370 Y9=R9*COS(L8)*S8
380 PRINT " # NAME SET EPOCH ORBIT"
390 PRINT "Auto = 1"
400 II%=2
410 READ S$,I$,Y0%,T0,I0,O0,E0,W0,M0,N0,K0&,F0!,SM(II%):S$(II%)=S$
420 IF S$="END" THEN 440
430 PRINT II%;S$;" ";I$;Y0%*1000+INT(T0);K0&:II%=II%+1:GOTO 410
440 INPUT "ENTER NUMBER";J%:IF J%<1 OR J%>II%-1 THEN 440
450 IF J%>2 THEN AU%=0:GOTO 480
460 AU%=1:FOR J%=3 TO II%-1:GOSUB 520:NEXT J%
470 GOTO 160
480 PRINT "STEP";SM(J%);"MINUTES, CHANGE (Y/N) ?";
485 GOSUB 2205:T9=SM(J%)
490 IF ZZ$="Y" THEN INPUT "STEP (MINUTES) ";T9
500 GOSUB 520:PRINT "C/R FOR NEXT";:GOSUB 2205
510 GOTO 160
520 T9=T9/1440
530 RESTORE
540 T7=T1:YQ%=U3%
550 REM NAME, SET,YR,EPOCH DAY,INCLINAT,RIGHT AS,ECCENTRIC
560 REM ARG PERI,MEAN ANO,MEAN MOTION,ORBIT,BECON,STEP
670 DATA RS10/11,000,88,193.954191,82.9274,129.4663,0.001042
680 DATA 278.2806,81.7183,13.71899,5274,29.3570,5
690 DATA AO-9, 917,88,194.0722490,097.61320,227.7315,0.0000590
700 DATA 304.6349,055.4759,15.336921,37655,145.825,5
710 DATA AO10, 253,88,186.850606,027.294200,315.8593,0.602848
720 DATA 317.7381,8.97050,02.058791,3906,145.81,30
730 DATA AO11, 156,88,189.096702,098.05440,251.32790,0.001362
740 DATA 333.3629,26.6891,14.623456,23209,145.825,5
750 DATA AO12, 000,88,191.564757,50.01610,271.50550,0.001121
760 DATA 193.47800,166.5756,12.443951,8674,435.795,5
762 DATA AO13, 000,88,193.900,57.6540,247.538,0.653892
764 DATA 187.221,357.217,2.09698,45,145.812,30
770 DATA END,0,0,0,0,0,0,0,0,0,0,0,0,0
780 REM
790 READ S$,I$,Y0%,T0,I0,O0,E0,W0,M0,N0,K0&,F0!,SM
800 IF S$<>S$(J%) THEN 790
810 IF AU%=1 THEN T9=SM/1440
820 IF Y0%<>U3% THEN PRINT "UPDATE ELEMENT YEAR or ELEMENT SET":STOP
830 PRINT
840 PRINT S$;" ID:";I$;" REF:";T0;" AGE:";INT(T1-T0);" FQ:";F0!
850 E3=E0^2
860 E2=1-E3
870 E1=SQR(E2)
880 Q0=M0/360+K0&
890 A0=(G0/N0^2)^(1/3)
900 V=R0!/A0
910 K2=9.95*V^3.5/E2^2
920 V=I0*PR
930 S1=SIN(V)
940 C1=COS(V)
950 T=T7
960 GOSUB 1190
970 FL%=2
980 LN%=0
990 PRINT "CALCULATING":PRINT
1000 REM
1010 FOR T=T7 TO T8 STEP T9
1020 K7%=INT(T)
1030 Q=N0*(T-T0)+Q0
1040 K&=INT(Q)
1050 M9=INT((Q-K&)*256)
1060 M=(Q-K&)*P2
1070 IF FL%=0 THEN GOSUB 1190
1080 GOSUB 1350
1090 IF E9<E8% THEN 1130
1100 IF FL%>0 THEN FL%=2:GOSUB 1660:GOTO 1160
1110 T=T7+T9*INT((T-T7)/T9-1):FL%=1
1120 GOTO 1020
1130 IF FL%=1 THEN 1160
1140 D=R5*D*D*1E-09:FL%=0
1150 IF D>(.2/N0) THEN T=T+(.2/N0) ELSE T=T+D
1160 NEXT T:PRINT
1170 RETURN
1180 REM
1190 V=(T-T0)*K2
1200 O=(O0-V*C1)*PR
1210 S0=SIN(O)
1220 C0=COS(O)
1230 W=(W0+V*(2.5*C1^2-.5))*PR
1240 S2=SIN(W)
1250 C2=COS(W)
1260 V=S2*S0:V1=C2*S0:V2=C2*C0:V3=S2*C0
1270 D=V*C1
1280 XA=V2-D
1290 XB=-V3-V1*C1
1300 YA=V1+V3*C1
1310 YB=V2*C1-V
1320 ZA=S2*S1
1330 ZB=C2*S1
1340 RETURN
1350 E=M+E0+SIN(M)+.5*E3*SIN(2*M)
1360 S3=SIN(E):C3=COS(E):R3=1-E0*C3:M5=E-E0*S3-M
1370 IF ABS(M5)>.000001 THEN E=E-M5/R3:GOTO 1360
1380 XX=A0*(C3-E0)
1390 YY=A0*E1*S3
1400 R=A0*R3
1410 X1=XX*XA+YY*XB
1420 Y1=XX*YA+YY*YB
1430 G7=T*G1+G2:G7=(G7-INT(G7))*P2
1440 S7=-SIN(G7):C7=COS(G7)
1450 X=X1*C7-Y1*S7
1460 Y=X1*S7+Y1*C7
1470 Z=XX*ZA+YY*ZB
1480 X5=X-X9
1490 Y5=Y-Y9
1500 Z5=Z-Z9
1510 R5=SQR(X5^2+Y5^2+Z5^2)
1520 IF T6<>T THEN R8=((R6-R5)/(T6-T))/86400& ELSE R8=-8999999000#
1530 R6=R5:T6=T
1540 V=X5*C8+Y5*S8
1550 Z8=V*C9+Z5*S9
1560 S5=Z8/R5
1570 E9=ATN(S5/SQR(1-S5^2))/PR
1580 RETURN
1590 REM
1600 D=ATN(DY/DX)/PR:IF DX<0 THEN D=D+180:RETURN
1610 IF DX>0 THEN 1640
1620 IF DY>=0 THEN D=90 ELSE D=270
1630 RETURN
1640 IF DY<0 THEN D=D+360
1650 RETURN
1660 DX=Z5*C9-V*S9
1670 DY=Y5*C8-X5*S8
1680 GOSUB 1600
1690 A9=D
1700 DX=X
1710 DY=Y
1720 GOSUB 1600
1730 B5=Z/R
1740 L5=ATN(B5/SQR(1-B5^2))/PR
1745 REM
1750 TZ=T-ZT:K7%=INT(TZ)
1760 TL%=1:IF T=TK+T9 THEN TL%=0
1770 IF TL%=0 AND KQ%=K7% AND LN%>0 THEN 1830
1780 I%=13:KQ%=K7%:IF KQ%>365 THEN KQ%=1:YQ%=86
1790 I%=I%-1:IF KQ%<C%(I%)+1 THEN 1790
1800 Q$=STR$(I%*10000+(KQ%-C%(I%))*100+YQ%)+" "
1810 PRINT " HOR";E8%;" DAY";K7%;Q$;"ORBIT";K&;S$;" ";I$:LN%=LN%+1
1820 IF PRT%=1 THEN PRINT#1," HOR";E8%;" DAY";K7%;Q$;"ORBIT";K&;S$;" ";I$
1830 H4=INT((TZ-K7%)*24+.0001):M4=INT((TZ-K7%)*1440-H4*60+.1)
1835 H4$=RIGHT$(STR$(10000+H4*100+M4),4)
1840 TK=T
1850 IF LN%>1 THEN 1880
1860 PRINT EXT$;" AZ EL D-HZ R-KM H-KM LAT LON PHS":LN%=LN%+1
1870 IF PRT%=1 THEN PRINT#1,EXT$;" AZ EL D-HZ R-KM H-KM LAT LON PHS"
1880 REM
1890 MO$="":IF S$<>"AO10" THEN 1925
1895 IF M9>=50 AND M9<=119 THEN MO$=" B"
1900 IF M9>=120 AND M9<=136 THEN MO$=" L"
1901 IF M9>=137 AND M9<=199 THEN MO$=" B"
1921 IF M9>=200 AND M9<=219 THEN MO$=" OFF"
1922 IF M9>=220 AND M9<=244 THEN MO$=" B"
1923 IF M9>=245 OR M9<=49 THEN MO$=" OFF"
1925 PRINT H4$;
PRINT USING "####";A9;
PRINT USING "####";E9;
PRINT USING "######";-F0!*R8/.2997925;
PRINT USING "#######";R5;
PRINT USING "#######";R-R0!;
PRINT USING "####";L5;
PRINT USING "####";360-D;
PRINT USING "####";M9;:LN%=LN%+1
PRINT MO$
IF PRT%=0 THEN 2030 :REM NOT PRINTER
1930 PRINT#1,H4$;
PRINT#1,USING "####";A9;
PRINT#1,USING "####";E9;
PRINT#1,USING "######";-F0!*R8/.2997925;
PRINT#1,USING "#######";R5;
PRINT#1,USING "#######";R-R0!;
PRINT#1,USING "####";L5;
PRINT#1,USING "####";360-D;
PRINT#1,USING "####";M9;
PRINT#1,MO$
IF LN%>PPL% THEN PRINT#1,CHR$(12):LN%=0
2030 IF DISK%=0 THEN 2160 :REM NOT DISK
IF TL%=1 THEN PRINT#2,Q$;S$;K&
PRINT#2,Q$;
PRINT#2,H4$;
PRINT#2,USING "####";A9;
PRINT#2,USING "####";E9;
PRINT#2,USING "######";-F0!*R8/.2997925;
PRINT#2,USING "#######";R5;
PRINT#2,USING "#######";R-R0!;
PRINT#2,USING "####";L5;
PRINT#2,USING "####";360-D;
PRINT#2,USING "####";M9;
PRINT#2,MO$
RETURN
2160 REM
2190 IF PRT%=1 OR LN%<23 THEN 2200
LN%=0:PRINT "QUIT (Y/N) ";
2195 GOSUB 2205
IF ZZ$="Y" THEN 160
2200 RETURN
REM
2205 ZZ$=INKEY$: IF ZZ$="" THEN 2205 ELSE PRINT ZZ$
IF ZZ$="y" THEN ZZ$="Y"
RETURN
REM S$=SAT NAME A9=AZIM
REM I$=SAT ELEM E9=ELEV L9=STAT LAT
REM Y0%=SAT YEAR L5=LAT W9=STAT LONG
REM T0=SAT DAY M9=PHASE H9=STAT ELEV
REM I0=SAT INCL E8%=STAT HOR
REM O0=SAT RA K7%=DAY R0!=EARTH RAD
REM E0=SAT ECCE T7=STRT TIME
REM W0=SAT AP T8=STOP TIME
REM M0=SAT MA T9=STEP TIME
REM N0=SAT MM R5=RANGE
REM H4=UTC HRS
REM K0&=SAT REV M4=UTC MINS TL%=PRINT SEPA
REM F0!=SAT FREQ R8=VELOCITY MO$=AO10 MODE LN%=LINE COUNT
REM K2=d AP W=NEW AP FL%=FLAG PR=PI RADIANS
REM 10703 78-026-B AO-8
REM 12888 81-100-B AO-9
REM 12997 81-120-A RS-3
REM 12998 81-120-B RS-8
REM 12999 81-120-C RS-5
REM 13000 81-120-D RS-4
REM 13001 81-120-E RS-7
REM 13002 81-120-F RS-6
REM 14129 83-058-B AO10
REM 14781 84-021-B AO11
REM 15935 85-066-A AO24 (NOT HAM)
REM 15936 85-066-B AO30 (NOT HAM)